﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using MoneyWentWhere.WinFormsUI.UI.DataGrid;

namespace MoneyWentWhere.WinFormsUI.UI.DataGrid
{
    public interface IAutoCompletePopup
    {
        /// <summary>
        /// Show the popup and initialize given the host.
        /// Normally popup would return focust.
        /// </summary>
        /// <param name="host"></param>
        void ShowPopup(IAutoCompletePopupHost host);

        /// <summary>
        /// Close the popup and clean up with current host
        /// </summary>
        void ClosePopup();

        /// <summary>
        /// Determine if input key should be processed.
        /// DO NOT PROCESS IT HERE
        /// Normally, popup would return focus.
        /// </summary>
        /// <param name="keys"></param>
        /// <returns></returns>
        bool PopupWantsInputKey(Keys keys);

        /// <summary>
        /// Process the input key while not focused.
        /// Normally, popup would return focus.
        /// </summary>
        /// <param name="key"></param>
        void OnHostKeyDown(KeyEventArgs key);

        /// <summary>
        /// Commit edited value to host
        /// </summary>
        void CommitValue();
    }
}
